{template 'web/_header'}
{template 'web/allorder/goldshop_tabs'}
<form action="" method="get" class='form-horizontal'>
        <input type="hidden" name="c" value="site" />
        <input type="hidden" name="a" value="entry" />
        <input type="hidden" name="m" value="ewei_shop" />
        <input type="hidden" name="do" value="allorder" />
        <input type="hidden" name="p"  value="goldshop_list" />
        <input type="hidden" name="op" value="detail" />
        <input type="hidden" name="id" value="{$_GPC['id']}" />
    <div class='panel panel-default'>
        <div class='panel-heading'>
            兑换记录详细信息
        </div>
        <div class='panel-body'>
           
                              
             <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">类型</label>
                <div class="col-sm-9 col-xs-12">
                    <div class='form-control-static'>
                         {if $goods['type']==1}
                              <span class='label label-danger'>抽奖</span>
                              {else}
                              <span class='label label-primary'>兑换</span>
                              {/if}
                    </div>
                </div>
            </div>
                              
               <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">商品</label>
                <div class="col-sm-9 col-xs-12">
                     <img src='{php echo tomedia($goods['thumb'])}' style='width:30px;height:30px;padding:1px;border:1px solid #ccc' />
                         {$goods['title']}
                </div>
            </div>
                                                   
             <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">粉丝</label>
                <div class="col-sm-9 col-xs-12">
                    <img src='{$member['avatar']}' style='width:30px;height:30px;padding:1px;border:1px solid #ccc' />
                         {$member['nickname']}
                </div>
            </div>
             <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">消耗</label>
                <div class="col-sm-9 col-xs-12">
                    <div class='form-control-static'>
                        {if $log['gold_card']>0}-{$log['gold_card']}金币<br/>{/if}
                              {if $log['credit']>0}
                              -{$log['credit']}现金
                              {/if}
                             {if $log['weixin']>0}
                              -{$log['weixin']}现金
                              {/if}
                        
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">收货人：</label>
                <div class="col-sm-9 col-xs-12">
                    <div class='form-control-static'>
                    {$log['realname']}
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">手机号码：</label>
                <div class="col-sm-9 col-xs-12">
                    <div class='form-control-static'>
                    {$log['mobile']}
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">收货地址：</label>
                <div class="col-sm-9 col-xs-12">
                    <div class='form-control-static'>
                    {$log['province']} {$log['city']} {$log['area']} {$log['address']}
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">参与时间</label>
                <div class="col-sm-9 col-xs-12">
                    <div class='form-control-static'>{php echo date('Y-m-d H:i:s',$log['createtime'])}</div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">运费：</label>
                <div class="col-sm-9 col-xs-12">
                    <div class='form-control-static'>
                    {if $log['dispatchmoney']==0}
                    免运费
                    {else}
                    {$log['dispatchmoney']}元
                    {/if}
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">状态</label>
                <div class="col-sm-9 col-xs-12">
                     <div class='form-control-static'>
                        {if empty($goods['type'])}
                              {if $log['status']==2}
                              <span class='label label-success'>待发货</span>
                              {elseif $log['status']==3}
                              <span class='label label-danger'>已发货</span>
                              {elseif $log['status']==4}
                              <span class='label label-default'>已完成</span>
                              {/if}
                             {else}
                              {if $log['status']==1}
                               <span class='label label-default'>未中奖</span>
                              {elseif $log['status']==2}
                              <span class='label label-success'>已中奖</span>
                              {elseif $log['status']==3}
                              <span class='label label-danger'>已兑奖</span>
                              {/if}  
                             {/if}
                     </div>
                </div>
            </div>
            
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">支付状态</label>
                <div class="col-sm-9 col-xs-12">
                     <div class='form-control-static'>
                      {if $log['paytype']==-1}
                              <span class='label label-default'>无需支付</span>
                              {else}
                                    {if $log['paytype']==0}
                                        {if $log['paystatus']==0}
                                        <span class='label label-default'>余额未支付</span>
                                        {else}
                                        <span class='label label-warning'>余额已支付</span>
                                        {/if}
                                    {elseif $log['paytype']==1}
                                      {if $log['paystatus']==0}
                                        <span class='label label-default'>微信未支付</span>
                                        {else}
                                        <span class='label label-warning'>微信已支付</span>
                                        {/if}
                                    {/if}
                               {/if}
                     </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">运费支付状态</label>
                <div class="col-sm-9 col-xs-12">
                    <div class='form-control-static'>
                       {if $log['dispatchstatus']==-1}
                                   <span class='label label-default'>无需支付</span>
                              {elseif $log['dispatchstatus']==0}
                                    <span class='label label-default'>未支付</span>
                              {elseif $log['dispatchstatus']==1}
                                    <span class='label label-success'>已支付</span>
                              {/if}
                              </div>
                </div>
            </div>
            {if $log['status']>2}
            <div class="form-group">

                <label class="col-xs-12 col-sm-3 col-md-2 control-label">发货信息 :</label>

                <div class="col-sm-9 col-xs-12">
                
                    <p class="form-control-static">
                    快递公司: {$log['expresscom']}  <br/>
                    快递单号: {$log['expresssn']} <br/>
                    发货时间: {php echo date('Y-m-d H:i:s', $log['sendtime'])}</p>

                </div>

            </div>
            {/if}
            {if !empty($address['realname'])}
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">收件人信息</label>
                <div class="col-sm-9 col-xs-12">
                       收  件 人: {$log['realname']} / {$log['mobile']}<br/>
                       收货地址: {$log['province']}{$log['city']}{$log['area']} {$log['address']}
                </div>
            </div>
            {/if}
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">修改收件人信息</label>
                <div class="col-sm-9 col-xs-12">
                       收  件  人： <input type="text" name="realname" value="{$log['realname']}"><br/><br/>
                       联系电话：<input type="text" name="mobile" value="{$log['mobile']}"><br/><br/>
                       收货地址：<input type="text" name="province" value="{$log['province']}">-<input type="text" name="city" value="{$log['city']}">-<input type="text" name="area" value="{$log['area']}">-<input type="text" name="address" value="{$log['address']}">
                       <input type="submit" class="btn btn-primary" name="submit" value="确认修改"  />
                </div>
            </div>
            
              <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label"></label>
                <div class="col-sm-9 col-xs-12">
                     {ifp 'creditshop.log.exchange'}
                        {if $log['canexchange']}
                                <a class='btn btn-primary' href="javascript:;" onclick='exchange({php echo json_encode($address)})' title='确认兑换' >确认兑换</a>
                        {/if}
                    {/if}

                <input type="button" class="btn btn-default" name="submit" onclick="history.go(-1)" value="返回列表"  {ifp 'creditshop.log.exchange'}{if $log['canexchange']}style='margin-left:10px;'{/if}{/if}  />
                </div>
            </div>
        </div>
    </div>   
</form>
{template 'web/allorder/goldshop_modal'}
<script language='javascript'>
            function exchange(address){
            $('#modal-exchange').find(':input[name=id]').val(address.logid);
                    $('#express').val('');
                    $('#expresscom').val('');
                    $(':input[name=expresssn]').val('');
                    if (address.realname){
            $('#expressform').show();
                    $('#realname').html(address.realname);
                    $('#mobile').html(address.mobile);
                    $('#address').html(address.province + address.city + address.area + " " + address.address);
            } else{
            $('#expressform1').show();
            }
            $('#modal-exchange').modal();
            }
</script>
<script language='javascript'>
    $(function (){

    $("#express").change(function () {
    var obj = $(this);
            var sel = obj.find("option:selected").attr("data-name");
            $("#expresscom").val(sel);
    });
    })
</script>
{template 'web/_footer'}